/*
 *
 * Copyright (c) 2013-2021, Alibaba Group Holding Limited;
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: TxnStream.proto

package com.aliyun.polardbx.binlog.protocol;

/**
 * Protobuf enum {@code com.aliyun.polardbx.binlog.protocol.TxnType}
 */
public enum TxnType
    implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * *
     * 正常的DML
     * </pre>
     *
     * <code>DML = 0;</code>
     */
    DML(0),
    /**
     * <pre>
     * *
     * BINLOG协议描述
     * </pre>
     *
     * <code>FORMAT_DESC = 1;</code>
     */
    FORMAT_DESC(1),
    /**
     * <pre>
     * *
     * 元信息：逻辑DDL
     * </pre>
     *
     * <code>META_DDL = 2;</code>
     */
    META_DDL(2),
    /**
     * <pre>
     * *
     * 元信息：Storage发生ScaleOut or ScaleIn
     * </pre>
     *
     * <code>META_SCALE = 3;</code>
     */
    META_SCALE(3),
    /**
     * <pre>
     * *
     * 元信息：逻辑DDL(PolarX私有类型的DDL)
     * </pre>
     *
     * <code>META_DDL_PRIVATE = 4;</code>
     */
    META_DDL_PRIVATE(4),
    /**
     * <pre>
     * *
     * 元信息：心跳信息
     * </pre>
     *
     * <code>META_HEARTBEAT = 5;</code>
     */
    META_HEARTBEAT(5),
    /**
     * <pre>
     * *
     * 元信息：config配置变更
     * </pre>
     *
     * <code>META_CONFIG_ENV_CHANGE = 6;</code>
     */
    META_CONFIG_ENV_CHANGE(6),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * *
     * 正常的DML
     * </pre>
     *
     * <code>DML = 0;</code>
     */
    public static final int DML_VALUE = 0;
    /**
     * <pre>
     * *
     * BINLOG协议描述
     * </pre>
     *
     * <code>FORMAT_DESC = 1;</code>
     */
    public static final int FORMAT_DESC_VALUE = 1;
    /**
     * <pre>
     * *
     * 元信息：逻辑DDL
     * </pre>
     *
     * <code>META_DDL = 2;</code>
     */
    public static final int META_DDL_VALUE = 2;
    /**
     * <pre>
     * *
     * 元信息：Storage发生ScaleOut or ScaleIn
     * </pre>
     *
     * <code>META_SCALE = 3;</code>
     */
    public static final int META_SCALE_VALUE = 3;
    /**
     * <pre>
     * *
     * 元信息：逻辑DDL(PolarX私有类型的DDL)
     * </pre>
     *
     * <code>META_DDL_PRIVATE = 4;</code>
     */
    public static final int META_DDL_PRIVATE_VALUE = 4;
    /**
     * <pre>
     * *
     * 元信息：心跳信息
     * </pre>
     *
     * <code>META_HEARTBEAT = 5;</code>
     */
    public static final int META_HEARTBEAT_VALUE = 5;
    /**
     * <pre>
     * *
     * 元信息：config配置变更
     * </pre>
     *
     * <code>META_CONFIG_ENV_CHANGE = 6;</code>
     */
    public static final int META_CONFIG_ENV_CHANGE_VALUE = 6;

    public final int getNumber() {
        if (this == UNRECOGNIZED) {
            throw new java.lang.IllegalArgumentException(
                "Can't get the number of an unknown enum value.");
        }
        return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TxnType valueOf(int value) {
        return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static TxnType forNumber(int value) {
        switch (value) {
        case 0:
            return DML;
        case 1:
            return FORMAT_DESC;
        case 2:
            return META_DDL;
        case 3:
            return META_SCALE;
        case 4:
            return META_DDL_PRIVATE;
        case 5:
            return META_HEARTBEAT;
        case 6:
            return META_CONFIG_ENV_CHANGE;
        default:
            return null;
        }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<TxnType>
    internalGetValueMap() {
        return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<
        TxnType> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<TxnType>() {
            public TxnType findValueByNumber(int number) {
                return TxnType.forNumber(number);
            }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
    getValueDescriptor() {
        if (this == UNRECOGNIZED) {
            throw new java.lang.IllegalStateException(
                "Can't get the descriptor of an unrecognized enum value.");
        }
        return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptorForType() {
        return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptor() {
        return com.aliyun.polardbx.binlog.protocol.TxnStream.getDescriptor().getEnumTypes().get(1);
    }

    private static final TxnType[] VALUES = values();

    public static TxnType valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
            throw new java.lang.IllegalArgumentException(
                "EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1) {
            return UNRECOGNIZED;
        }
        return VALUES[desc.getIndex()];
    }

    private final int value;

    private TxnType(int value) {
        this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:com.aliyun.polardbx.binlog.protocol.TxnType)
}

